import Vue from 'vue'
import VueRouter from 'vue-router'
import FindMusic from '../components/FindMusic.vue'
import AnchorTower from '../components/findmusic/AnchorTower.vue'
import Geshou from '../components/findmusic/Geshou.vue'
import NewMusic from '../components/findmusic/NewMusic.vue'
import Rank from '../components/findmusic/Rank.vue'
import Recommend from '../components/findmusic/Recommend.vue'
import SongSheet from '../components/findmusic/SongSheet.vue'
import SongList from '../components/findmusic/SongList.vue'
import Video from '../components/Video.vue'
import SearchPage from '../components/SearchPage.vue'
import FindSingerPage from '../components/search/FindSingerPage.vue'
import FindSongPage from '../components/search/FindSongPage.vue'
import FindSongVideo from '../components/search/FindSongVideo.vue'
//解决ElementUI导航栏中的vue - router在3 .0 版本以上重复点菜单报错问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}

Vue.use(VueRouter)

const routes = [{
        path: '/findMusic',
        component: FindMusic,
        children: [{ path: '/anchorTower', component: AnchorTower },
            { path: '/geshou', component: Geshou },
            { path: '/newMusic', component: NewMusic },
            { path: '/rank', component: Rank },
            { path: '/recommend', component: Recommend },
            { path: '/songSheet', component: SongSheet },

        ]
    },
    { path: '/songList/:id', component: SongList },
    { path: '/video', component: Video },
    { path: '/findSongPage', component: FindSongPage },


]

const router = new VueRouter({
    routes
})

export default router